<template>
<uni-shadow-root class="partials-newsList-newsList"><import src="simpleNewsList.wxml"></import>  
<import src="newsListSlide/newsListSlide.wxml"></import>  
<import src="commonNewslist/commonNewslist.wxml"></import>  
<import src="gongyi_news_list/index.wxml"></import>  
<block v-if="data.androidTemplate == """>
    <template is="simpleNewsList" :data="...data"></template> 
</block>

<block v-if="data.androidTemplate == "news_list_slide"">
    <template is="newsListSlide" :data="...data"></template> 
</block>

<block v-if="data.androidTemplate == "common_news_list"">
    <template is="commonNewslist" :data="...data"></template> 
</block>

<block v-if="data.androidTemplate == "gongyi_news_list_page"">
    <template is="gongyi_news_list_page" :data="...data"></template> 
</block></uni-shadow-root>
</template>

<script>

global['__wxRoute'] = 'partials/newsList/newsList'
const app = getApp();
Component({
  properties: {
    data: {
      type: JSON,
      value: 'default value',
    }
  },
  data: {
    someData: {}
  },
  ready: function () {
      let that=this;
    // app.globalData.consoleFun("=====newsList组件-data=====",[that.data.data])
  },
  methods: {
    tolinkUrl: function (event) {
      app.globalData.consoleFun("=====newsList组件-id=====",[event.currentTarget.dataset.id])
      let itemData=event.currentTarget.dataset.item;
      let linkUrl='news_detail.html?id=' + itemData.id;
      if(itemData.linkUrl){
          linkUrl=itemData.linkUrl
      }
	  
	  app.globalData.linkEvent(linkUrl)
    }
  },
})
export default global['__wxComponents']['partials/newsList/newsList']
</script>
<style platform="mp-weixin">
@import 'newsListSlide/newsListSlide.css';/* 引入可以滑动的样式 */
@import 'commonNewslist/commonNewslist.css';/* 引入可以滑动的样式 */
@import 'gongyi_news_list/index.css';/* 引入可以滑动的样式 */
/*没有相关商品  */
.noproduct{
  width: 100%;
  height: 200rpx;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.font_1{
  font-weight: bold;
}
.noproduct image{
  width: 150rpx;
  height: 150rpx;
  margin: 0 auto;
}
.noproduct text{
  font-size: 26rpx;
}
.ListDataContainer{
  display: flex;
  flex-direction: column;
  border-top: 1px solid #ddd;
  font-size: 1em;
  padding: 0.8em;
  background: #f3f3f3;
}
.ListDataItem{
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0.8em;
  height: 4em;
  border-radius: 0.4em;
  margin-bottom: 0.8em;
  background: #fff;
}
.ListDataItemWord{
  width: 70%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: flex-start;
}
.lineheight_title{
  height:2em;
  line-height:2em;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 30rpx;
}
.ListDataItemWord text{ 
  margin-left:10px;
}
.ListDataItemWord .word2 {
  font-size: 25rpx;
  color: #aaa;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.ListDataItemImage{
  width: 30%;
  height: 100%;
  overflow: hidden;
  border-radius: 0.2em;
}
.ListDataItemImage image{
  width: 100%;
  height: 160rpx
}
</style>